package se.webbzon.boltzmann.game.environment;

import se.webbzon.boltzmann.battle.property.BattlePropertyFactoryGroup;
import se.webbzon.boltzmann.environment.AbstractEnvironment;
import se.webbzon.boltzmann.game.object.spawner.HostileNPCSpawnerInflator;
import se.webbzon.boltzmann.inflatorgroup.DefaultInflatorGroup;
import se.webbzon.boltzmann.inflatorgroup.InflatorGroupException;

public class GameInflatorGroup extends DefaultInflatorGroup {
	
	// The battle property factory group used to create battle properties
	private final BattlePropertyFactoryGroup bpfGroup;

	/*============================================================
	Constructors
	============================================================*/

	public GameInflatorGroup(BattlePropertyFactoryGroup bpfGroup) {
		this.bpfGroup = bpfGroup;
	}

	/*============================================================
	Public Methods
	============================================================*/

	@Override public void initialize(AbstractEnvironment env) throws Exception {
		if (!(env instanceof GameEnvironment))
			throw new InflatorGroupException(	"The abstract environment must " +
												"be an instance of " + 
												"GameEnvironment.");
		GameEnvironment genv = (GameEnvironment) env;
		super.initialize(genv);

		addInflator(new HostileNPCSpawnerInflator(genv,genv.getBattleEnvironment(),bpfGroup));
	}

}
